package com.me.mygdxgame;

import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.me.mygdxgame.Components.BoundingBox;
import com.me.mygdxgame.Components.Transform;
import com.me.mygdxgame.GameObjects.Tile;

public class TileFactory extends AbstractFactory {

	public TileFactory(){
	}
	
	@Override
	public GameObject create(Vector2 position) {
		Tile tile = new Tile();
		int size = Map.getTileSize();
		
		Transform transform = new Transform(position, new Vector2(1, 1),new Vector2(size,size));		
		Rectangle boxRectangle = new Rectangle(position.x, position.y, size, size);
		BoundingBox boundingBox = new BoundingBox(boxRectangle);
		//TODO: Add Renderer with Textureset for Tiles
		
		tile.addComponent(boundingBox);
		tile.addComponent(transform);
		
		return tile;
	}

}
